﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HerGoS.Administration.Entities;
using System.Diagnostics;
using System.Reflection;
using HerGoS.WebUI.GlobalUI;

namespace HerGoS.WebUI
{
    public class PageBase : System.Web.UI.Page
    {
        protected Modulo modulo;
        protected override void OnInitComplete(EventArgs e)
        {
            base.OnInitComplete(e);

            //Carga el modulo de la pagina actual
            modulo = SiteController.GetCurrentModulo();
            
        }

        protected void LoadAutoria(HerGoS.Interfaces.HGSEntity entidad)
        {
            if (entidad.OID != 0) //Verificar permisos
            {
                HerGoS.WebControlExtend.ImageButtonExt btn = new HerGoS.WebControlExtend.ImageButtonExt();
                btn.ID = "btnAuditoria";
                btn.Settings(new HerGoS.ControlsUI.ImageButtonExtAudit());
                btn.OnClientClick = "OpenAudit('" + entidad.GetType().Name + "', " + entidad.OID.ToString() + "); return false;";
                btn.Style.Add("position","absolute");
                btn.Style.Add("top", "0px");
                btn.Style.Add("right", "0px");
                this.Form.Controls.Add(btn);
            }
        }

    }
}